argss <- commandArgs(trailingOnly = TRUE)

print(argss)

het_bulk=argss[1]
het_single=argss[2]
hom_single=argss[3]

snp_het_bulk=read.table(het_bulk)
snp_het_single=read.table(het_single)
snp_hom_single=read.table(hom_single)

het_het=length(intersect(snp_het_bulk$V1, snp_het_single$V1))
het_hom=length(intersect(snp_het_bulk$V1, snp_hom_single$V1))

adr=het_hom/(2*het_het+het_hom)

# print(adr)

write.table(c("ADR", adr), file="1.adr.txt", quote=F, row.names=F, col.names=F)